package com.cmic.rcs.enhance.message.g5.core.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 枚举了一些常用API操作码
 */
@AllArgsConstructor
@Getter
public enum ReturnCodeEnum {
    SUCCESS(0, "success"),
    UNKNOWN_EXCEPTION(-1, "服务器异常，请稍后再试"),

    MVC_EXCEPTION(10000, "请求参数异常"),
    NULL_EXCEPTION(10001, "请求记录不存在"),
    VERIFICATION_FAILED(10002, "verification failed"),
    SERVICE_SIDE_EXCEPTION(10003, "service side exception"),
    //验证码已失效
    VERIFICATION_EXPIRED(10004, "验证码已失效"),
    //验证码错误
    VERIFICATION_ERROR(10005, "验证码错误"),

    // 登录相关错误码
    LOGIN_FAILED(10006, "登录失败"),
    PASSWORD_ERROR(10007, "密码错误"),
    ADMIN_NOT_EXIST(10008, "管理员不存在"),
    ACCOUNT_DISABLED(10009, "账号已被禁用"),
    ACCOUNT_LOCKED(10010, "账号已被锁定"),
    PASSWORD_EXPIRED(10011, "密码已过期"),
    PASSWORD_WILL_EXPIRE(10012, "密码即将过期"),

    // 会话相关错误码
    USER_NOT_LOGIN(10013, "用户未登录"),
    LOGOUT_FAILED(10014, "注销失败"),
    GET_USER_INFO_FAILED(10015, "获取用户信息失败"),
    SESSION_EXPIRED(10016, "会话已过期"),

    // 密码修改相关错误码
    PASSWORD_NOT_MATCH(10017, "两次输入的新密码不一致"),
    NEW_PASSWORD_SAME_AS_OLD(10018, "新密码不能与旧密码相同"),
    // 系统错误
    SYSTEM_ERROR(99999, "系统错误"),


    ;

    private int code;
    private String msg;

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
